package com.zcc.read_file;


import org.springframework.stereotype.Component;

import java.io.FileInputStream;
import java.io.InputStream;

@Component
public class FileService {

    public static String FILE_PATH = "file/test.txt";


    public String readFile() {

        InputStream inputStream = null;
        try {
//            inputStream = new FileInputStream(FILE_PATH);
            inputStream = this.getClass().getClassLoader().getResourceAsStream(FILE_PATH);
            System.out.println("123213233####");

            System.out.println("12321321dsd##");

            System.out.println(1111);
            System.out.println(1111);
            System.out.println(1111);
            System.out.println(1111);
        } catch (Exception e) {

            throw new RuntimeException(e.getMessage());
        }
        return "读取文件成功!";
    }


}
